package game;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
//
//	Plat 01 - 100% 
//	Plat 02 - 75%
//  Plat 03 - Aprox 25%
//
public class Quadrado extends Sprite {
	float VelX;
	float VelY;
	int pos;
	public Quadrado(BufferedImage bg, float x, float y, float tx, float ty, int pos) {
		super(bg, x, y, tx, ty);
		this.pos = pos;
	}



	
	@Override
	public void Simulase(long diffTempo) {
		// TODO Auto-generated method stub
		
		//VelX += -60f*diffTempo/1000;
		X += -180f*diffTempo/1000;
	}

	@Override
	public void Desenha(Graphics2D dbg) {
		
		dbg.setColor(Color.red);
		//dbg.fillRect((int)X, (int)Y, (int)TX, (int)TY);
		
		//PONTA ESQUERDA TOPO
		if(pos == 0){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 0, 0, 16, 16, null);
		}
		//MEIO TOPO
		if(pos == 1){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 16, 0, 32, 16, null);
		}
		//PONTA DIREITA TOPO
		if(pos == 2){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 32, 0, 48, 16, null);
		}
		//PONTA ESQUERDA TERRA
		if(pos == 3){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 0, 32, 16, 48, null);
		}
		//MEIO TERRA
		if(pos == 4){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 16, 32, 32, 48, null);
		}
		//PONTA DIREITA TERRA
		if(pos == 5){
			dbg.drawImage(Tela01.tilePlat, (int)X, (int)Y, (int)(X+TX), (int)(Y+TY), 32, 32, 48, 48, null);
		}
		
	}

}
